//
//  HNGroundLogic.h
//  HeroNuts
//
//  Created by Gelford on 11-4-14.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HNGround.h"
#import "HNGroundCell.h"


@interface HNGroundLogic : NSObject {
  int mapData_[MAP_SIZE];
  HNGroundCell *actorMap_[MAP_SIZE];
  int outputMap_[MAP_SIZE];
  int arrayOfArea_[MAP_SIZE];
  int actorPosition_;
}

+ (HNGroundLogic *) sharedGroundLogic;

- (void)addActor:(HNActor *)anActor inPosition:(CGPoint)actorPosition;
- (NSMutableArray *)getWalkAreaFrom:(CGPoint)actorPosition;
- (NSMutableArray *)getFlyAreaFrom:(CGPoint)actorPosition;
- (NSMutableArray *)getWalkRoute:(CGPoint)destination;

- (HNActor *)actorAtPosition: (CGPoint)position;
- (BOOL)currentActorCanReachPosition: (CGPoint)position;
- (NSMutableArray *)reachablePositionsAroundActor: (HNActor *)actor;
- (int)directionFromPosition: (CGPoint)position toActor: (HNActor *)actor;
- (BOOL)isPosition:(CGPoint)position occupiedByActor:(HNActor*)actor;

@end
